package com.foreknow.springioc;

import com.foreknow.bean.Admin;
import com.foreknow.controller.BusinessController;
import com.foreknow.service.impl.AdminServiceImpl;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpring {
    public static void main(String[] args) {
//        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        AdminServiceImpl service = (AdminServiceImpl) context.getBean("adminService");
//        service.add(new Admin());
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BusinessController businessController = (BusinessController) context.getBean("businesscontroller");
        businessController.excute();
    }


}
